/*
 $Id: heap_init.c,v 1.1 2005/05/20 22:33:44 olivier Exp $
 +----------------------------------------------------------------------+
 | Copyright : mFactories 2001, 2005 
 +----------------------------------------------------------------------+
 | Projet : DataStructure
 +----------------------------------------------------------------------+
 | $Source: /cvs/DataStructure/DataStructureLib/src/heap/heap_init.c,v $
 | $Author: olivier $
 | $Date: 2005/05/20 22:33:44 $
 | $Revision: 1.1 $ 
 +----------------------------------------------------------------------+
 | Description :                                              
    Gestion de tas                            
 +----------------------------------------------------------------------+
 | Historique :
 $Log: heap_init.c,v $
 Revision 1.1  2005/05/20 22:33:44  olivier
 Explosion des sources : 1 fichier = 1 fonction


 +----------------------------------------------------------------------+
*/

/**
 * Inclusions standards
 */
#include <ukapi.h>

/**
 * Inclusions locales
 */
#include <heap.h>

int heap_init( pheap_t heap, int (*compare)( const pointer_t cle1, const pointer_t cle2 ), void (*destroy)( pointer_t data ) ) 
{
	if ( heap == null )
	{
		return -1;
	}

	/* Initialisation du tas. */
	heap->size		= 0;
	heap->compare	= compare;
	heap->destroy	= destroy;
	heap->tree		= null;

	return 0;
}
